using System.Configuration;

namespace Drill.Configuration.ConfigFile
{
	public class SearchPathElement : ConfigurationElement, ISearchPathConfiguration
    {
		private const string EnabledAttributeName = "enabled";
        private const string PathAttributeName = "path";

		/// <summary>
		/// Gets a value indicating whether this element is enabled.
		/// </summary>
		/// <value>
		///   <c>true</c> if enabled; otherwise, <c>false</c>.
		/// </value>
		[ConfigurationProperty(EnabledAttributeName, DefaultValue = true, IsRequired = false)]
		public bool Enabled
		{
			get { return (bool)this[EnabledAttributeName]; }
		}

		/// <summary>
		/// Gets the configured absolute directory path or a relative path part.
		/// </summary>
		/// <value>
		/// The configured absolute directory path or a relative path part.
		/// </value>
		[ConfigurationProperty(PathAttributeName, IsRequired = true)]
        public string Path
        {
			get { return this[PathAttributeName] as string; }
        }
    }
}